package com.kcs.dc.report.model.logic;

import java.sql.Connection;
import java.sql.SQLException;
import com.kcs.common.utils.Constant;
import com.kcs.common.utils.LogWriter;
import com.kcs.common.utils.PropsUtils;
import com.kcs.dc.report.model.dao.CommonDAO;
import com.kcs.dc.report.model.dao.model.userActiveModel;


public class commonBL {
 		
	public final static String NON_ACTIVE = "N";
	
	public static boolean checkAuthenUsePage(String user_id, Connection conn, String menu_scode) throws SQLException {
		
		userActiveModel[] model = null;
		CommonDAO daoCommon = null;
		
		try{
			daoCommon = new CommonDAO();
			model = daoCommon.getUserActive(user_id, "", PropsUtils.getMessage(Constant.PROP_OTHER, menu_scode), conn);
			
			if (model == null || model[0].getActive_stauts().equals(NON_ACTIVE)) {
	        		        		
	        	return false;
	            
	        }
		
		}catch(SQLException e){
			LogWriter.error("commonBL [Method : checkAuthenUsePage] : " + e.getMessage(), Constant.LOGGER_APPLICATION);
			throw new SQLException();
		}
		return true;	
	}
	
	
}

	
